Skip to content

test: Currency + Language enums + DfxTransaction model (+13 tests)#352

Merged
TaprootFreak merged 1 commit into
developfrom
test/currency-language-models
May 15, 2026
Merged

test: Currency + Language enums + DfxTransaction model (+13 tests)#352
TaprootFreak merged 1 commit into
developfrom
test/currency-language-models

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 28 of the coverage push.

File Cases
`lib/styles/currency.dart` 5
`lib/styles/language.dart` 5
`lib/models/dfx_transaction.dart` 3

What's pinned

  • Currency: wire codes (`EUR` / `CHF`); enum has exactly 2 values; `fromCode` resolves canonical inputs; case-insensitive on input (production calls `toUpperCase` first); throws `StateError` on unknown.
  • Language: wire codes (`en` / `de`) and flag asset paths; enum has exactly 2 values; `fromCode` resolves canonical; case-SENSITIVE on input (the lookup does NOT lowercase — pinned because it's different from Currency); throws `StateError` on unknown.
  • DfxTransaction: is-a `Transaction` with inherited fields; carries `dfxId` + `rate` + `inputTxId` + `outputTxId`; rate / inputTxId / outputTxId are all optional (`isNull` check pins the constructor's default-null contract).

Test plan

  • `flutter analyze` clean
  • `flutter test` — 13 / 13 passing locally
  • CI green

Stage 28 of the coverage push.

- Currency (5): wire codes EUR / CHF; values has exactly 2 entries;
  fromCode resolves canonical; case-insensitive on input (production
  toUpperCases); throws StateError on unknown
- Language (5): wire codes 'en' / 'de' + flag asset paths; values has
  exactly 2 entries; fromCode resolves canonical; case-SENSITIVE on
  input (different from Currency — pinned); throws StateError on
  unknown
- DfxTransaction (3): is-a Transaction with inherited fields; carries
  dfxId + rate + inputTxId + outputTxId; rate / inputTxId /
  outputTxId are all optional
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 17:49
@TaprootFreak TaprootFreak merged commit 2fd0342 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/currency-language-models branch May 15, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant